package clusterMaker;

import functions.NCD;

public class BaseData {
	
	protected int nElements;
	protected String sData[];

		
	public BaseData(String data[]){
		this.nElements = data.length;
		this.sData = data;
	}
	
	public int nElements() { return this.nElements; }
	
	public String getValue(int index){
		return this.sData[index];
	}
	

	public double[][] getDistanceMatrix() {  // get distance matrix of elements in data set
		double[][] result = new double[this.nElements][this.nElements];
		double dis = 0.0;
		for (int i = 0; i < this.nElements; i++) {
			for (int j = i; j < this.nElements; j++) {
				dis = NCD.getNCD(this.getValue(i), this.getValue(j));
				result[i][j] = dis;
				result[j][i] = dis;
			}
		}
		return result;
	}
	

}
